import 'package:flutter/material.dart';
import '../widgets/login_dialog.dart';

class NavigationService {
  static final GlobalKey<NavigatorState> navigatorKey =
      GlobalKey<NavigatorState>();

  static bool _isShowingLogin = false;

  static void showLoginDialog() {
    final ctx = navigatorKey.currentContext;
    if (ctx == null || _isShowingLogin) return;

    _isShowingLogin = true;
    showDialog(
      context: ctx,
      barrierDismissible: false,
      builder: (context) => const LoginDialog(),
    ).whenComplete(() {
      _isShowingLogin = false;
    });
  }
}